#include <bits/stdc++.h>
using namespace std;
long fun(long x, long y)
{
    long t;
    if (x < y)
    {
        t = x;
        x = y;
        y = t;
    }
    while (y != 0)
    {
        t = x % y;
        x = y;
        y = t;
    }
    return abs(x);
}
int main()
{
    long n, a, b, e, d, t;
    cin >> n;
    char c;
    cin >> e >> c >> d;
    for (int i = 1; i < n; i++)
    {
        cin >> a >> c >> b;
        e = e * b + d * a;
        d = d * b;
        t = fun(e, d);
        e /= t;
        d /= t;
    }
    if (e % d == 0)
        cout << e / d;
    else
    {
        if (e / d)
            cout << e / d << " ";
        cout << e - e / d * d << "/" << d << endl;
    }
    return 0;
}